home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / misc / unix / unix_boot.lha / src / Supervisor.s < prev    next >
Encoding:
Text File  |  1991-12-09  |  670 b   |  30 lines

  1. # Copyright (C) 1991, Commodore Business Machines, Inc.
  2. #
  3. # Execute a short assembly language function in the supervisor mode of
  4. # the processor.  Supervisor() does not modify or save registers; the
  5. # user function has full access to the register set.  The user function
  6. # must end with an RTE instruction.
  7. #
  8. # A pointer to the code to execute is passed in a5.
  9. # An additional parameter can be passed in a2.
  10. #
  11.  
  12.     .set    ABSEXECBASE,4
  13.     .set    _LVOSupervisor,-0x1e
  14.  
  15.     .text
  16.     .globl    _supervisor
  17.  
  18. _supervisor:
  19.     movl    a5,sp@-
  20.     movl    a2,sp@-
  21.     movl    a6,sp@-
  22.     movl    sp@(16),a5
  23.     movl    sp@(20),a2
  24.     movl    ABSEXECBASE,a6
  25.     jbsr    a6@(_LVOSupervisor)
  26.     movl    sp@+,a6
  27.     movl    sp@+,a2
  28.     movl    sp@+,a5
  29.     rts
  30.